#!/usr/bin/env python3
# vim: tabstop=4 shiftwidth=4 expandtab

import argparse
import sys
import gmi2html
import fileinput

def main():
    parser = argparse.ArgumentParser(description='Convert text/gemini to text/html, print to stdout.')
    parser.add_argument('files', metavar='F', nargs='*', help='All files to convert. (Leave empty or \'-\' for stdin)')
    parser.add_argument('--inline-img', dest='inlineImg', action='store_true', help='Inline png, jpg/jpeg, gif, webp, avif, svg, tiff links.')
    args = parser.parse_args()

    print("\n".join(gmi2html.convert(fileinput.input(args.files), args.inlineImg)))

if __name__ == "__main__":

    main()

